package com.ztools.common.model.pc.store;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ztools.common.model.pc.BaseModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author seeTools
 * @since 2023-06-04
 */
@Data
@SuperBuilder
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@TableName("store_sale")
public class StoreSale extends BaseModel {

    private static final long serialVersionUID = 1L;


    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 订单号
     */
    @TableField(value = "payment_no")
    private String paymentNo;

    /**
     * 商品ID
     */
    @TableField(value = "commodity_id")
    private Long commodityId;

    /**
     * 商品名称
     */
    @TableField(exist = false)
    private String commodityName;

    /**
     * 应付金额
     */
    @JSONField(format = "#0.00")
    @TableField(value = "amount")
    private BigDecimal amount;

    /**
     * 支付金额
     */
    @JSONField(format = "#0.00")
    @TableField(value = "pay_amount")
    private BigDecimal payAmount;

    /**
     * 销售价
     */
    @JSONField(format = "#0.00")
    @TableField(value = "sale_price")
    private BigDecimal salePrice;

    /**
     * 利润
     */
    @JSONField(format = "#0.00")
    @TableField(value = "profit_amount")
    private BigDecimal profitAmount;

    /**
     * 支付时间
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "pay_date")
    private Date payDate;

    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @TableField(exist = false)
    private Date payDate1;

    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @TableField(exist = false)
    private Date payDate2;

    /**
     * 支付类型
     */
    @TableField(value = "pay_type")
    private String payType;

    /**
     * 支付类型名称
     */
    @TableField(exist = false)
    private String payTypeName;

    /**
     * 优惠券ids
     */
    @TableField(value = "coupon_ids")
    private String couponIds;

    /**
     * 会员ID
     */
    @TableField(value = "member_id")
    private Long memberId;

    /**
     * 会员名称
     */
    @TableField(exist = false)
    private String memberName;

    /**
     * 优惠券金额
     */
    @JSONField(format = "#0.00")
    @TableField(value = "coupon_discount")
    private BigDecimal couponDiscount;

    /**
     * 退款时间
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "refund_date")
    private Date refundDate;

    /**
     * 积分数量
     */
    @TableField(value = "point_amount")
    private Integer pointAmount;

    /**
     * 商品数量
     */
    @TableField(value = "quantity")
    private Integer quantity;

    /**
     * 成本价
     */
    @JSONField(format = "#0.00")
    private BigDecimal costPrice;

    /**
     * 图片地址
     */
    @TableField(exist = false)
    private String picUrls;

}
